package com.lcvc.xgy.springboot.webcontroller.backstage;

import com.lcvc.xgy.springboot.model.Admin;
import com.lcvc.xgy.springboot.service.Adminbean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller//声明spring控制器
//声明地址
@RequestMapping("/backstage")
public class adminManage {

    @Autowired
    private Adminbean adminbean;

    @GetMapping("/getAdmins")
    @ResponseBody
    public Map<String, Object> GetAdmins() {
        Map<String, Object> map = new HashMap<>();
        List<Admin> admins =adminbean.getAllAdmin();
        map.put("time", new Date());
        map.put("data",admins);
        return map;

    }

    }

